# Compiler and flags
CC = cc68x
CFLAGS = -g -c -I.
LDFLAGS = -g
RM = rm

# Source files and objects
SRCS = bbreak.c  ..\stg3\model.c ..\stg4\render.c ..\stg2\raster.c ..\stg4\bitmap.c
OBJS = bbreak.o model.o render.o raster.o bitmap.o 
EXEC = bbreak

# Default target
all: $(EXEC)

# Linking
$(EXEC): $(OBJS)
	$(CC) $(LDFLAGS) $(OBJS) -o $(EXEC)

# Compiling C files
bbreak.o: bbreak.c bbreak.h
	$(CC) $(CFLAGS) -o bbreak.o bbreak.c

model.o: ..\stg3\model.c ..\stg3\model.h
	$(CC) $(CFLAGS) -o model.o ..\stg3\model.c

render.o: ..\stg4\render.c ..\stg4\render.h
	$(CC) $(CFLAGS) -o render.o ..\stg4\render.c

bitmap.o: ..\stg4\bitmap.c ..\stg4\bitmap.h
	$(CC) $(CFLAGS) -o bitmap.o ..\stg4\bitmap.c

# Compile raster.c (with correct path)
raster.o: ..\stg2\raster.c ..\stg2\raster.h
	$(CC) $(CFLAGS) -o raster.o ..\stg2\raster.c

# Clean rule
clean:
	$(RM) -f *.o $(EXEC)
